﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Apps/MasterPage.master" AutoEventWireup="false"
    CodeFile="Welcome.aspx.vb" Inherits="Apps_Welcome" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" runat="Server">
    <center>
        <b>
            <asp:Label ID="logName" runat="server" CssClass="login" />
        </b>
    </center>
    <br />
    <asp:ListView ID="lvDisplay" runat="server" DataKeyNames='main_system_code' EnableModelValidation="True"
        DataSourceID="lvDisplaySrc">
        <EmptyDataTemplate>
            <%= Resources.Resource.MSG_DATA_WERE_NOT_FOUND%>
        </EmptyDataTemplate>
        <LayoutTemplate>
            <div style='width: 100%; min-height: 500px; float: left;'>
                <asp:PlaceHolder ID='itemPlaceholder' runat='server' />
            </div>
            <%-- ====================== Data Pager ======================--%>
            <div style="clear: both;"></div>
            <div style="font-family:'MS Sans Serif';font-size:14px;text-align:center;">หน้าที่ :
                <asp:DataPager ID="paging" runat="server" PagedControlID="lvDisplay" PageSize='10'>
                    <Fields>
                        <asp:NextPreviousPagerField ShowFirstPageButton="false" ShowLastPageButton="false"
                            ShowNextPageButton='false' ShowPreviousPageButton='true' PreviousPageText='<' />
                        <asp:NumericPagerField />
                        <asp:NextPreviousPagerField ShowFirstPageButton="false" ShowLastPageButton="false"
                            ShowNextPageButton='true' ShowPreviousPageButton='false' NextPageText='>' />
                    </Fields>
                </asp:DataPager>
            </div>
            <%-- ====================== Data Pager ======================--%>
        </LayoutTemplate>
        <ItemTemplate>
            <%--<%#IIf((Convert.ToInt32(Eval("seq_no")) - 1) Mod 4 = 0, "<div style='clear:both;'>&nbsp;</div>", "")%>--%>
            <div style='width: 180px; margin-bottom: 3px; height: 100px; text-align: center;float: left;'>
                <asp:Image ID="img_system_pic" runat="server" onMouseOver="style.cursor='hand'" ImageUrl='<%# IIf(Eval("main_system_picture") is DBNull.value, "../picture/Folder.png", "../Images/" & Eval("main_system_picture"))  %>' Width="50px" Height="50px" onclick='<%# String.Format("openMainSystem({0}); ",Eval("main_system_code"))   %>' />
                <br /><%#Eval("main_system_name")%>
            </div>
        </ItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="lvDisplaySrc" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
        SelectCommand="USP_GetSystemListByUserPrivilege" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:SessionParameter Name='staff_code' Type='Int32' SessionField="staff_code" />
            <%-- <asp:SessionParameter Name='department_code' Type='Int32' 
                SessionField="department_code" />
            <asp:SessionParameter Name='group_user_code' Type='Int32' 
                SessionField="group_user_code" />
                <asp:SessionParameter Name="group_user_type" Type='Int32'
                SessionField ="group_user_type" /> --%>
        </SelectParameters>
    </asp:SqlDataSource>

    <script type="text/javascript">
        function openMainSystem(id) {
            window.open(String.format('viewsystem.aspx?Edit={0}', id), '_self');
        }
    </script>

</asp:Content>
